// JavaScript Document
$(function(){
})

function formsubmit(obj,urls,vali){
	if(vali == 1 && !$(obj).valid()){
		return false;
	}
	$.ajax({
		url      : urls,
		data     : $(obj).serialize(),
		type     : "POST",
		success  : function(data){
			$.dialog.tips(data.info,'2','32X32/i.png',function(){
				if(data.url != '' && data.url != 'undefined' && data.url != null){
                    window.location.href = data.url;
				}else{
					location.reload();
				}
			});
		},
		dataType : "json"
	});
	return false;
}

function confirmtip(urls,title,content){
	var $title = $content = "";
	if(title == '' || title == 'undefined' || title == null){
		$title = "删除信息";
	}else{
		$title = title;
	}
	if(content == '' || content == 'undefined' || content == null){
		$content = "您确定删除该信息"
	}else{
		$content = content;
	}
	$.dialog({
		title     : $title,
		content   : $content,
		ok        : function(){
			jQuery.ajax({
				url      : urls,
				type     : 'POST',
				success  : function(data){
					jQuery.dialog.tips(data.info,'2','32X32/i.png',function(){
						location.reload();
					})
				},
				dataType : 'json'
			})
		},
		cancel    : function(){
		}
	})
}

function removefile(ID){
	$.dialog.confirm('您确定要删除该文件?', function(){
		$(ID).parent('li').remove();
	}, function(){
		$.dialog.tips('执行取消操作');
	});
}